<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>loadplots</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 24/01/2006</div>
    <p>
      <b>loadplots</b> - loads and formats saved old style
  plots</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>rec=loadplots(fil)</tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>fil</b>
        </tt>: character string giving the path of the binary file containing
          the save of a graphic (old style)</li>
      <li>
        <tt>
          <b>rec</b>
        </tt>: A data structure (see Description below)</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>Given a file generated by <tt>
        <b>xsave</b>
      </tt> of by the save menu in
    graphic window this function returns a data structure containing the
    context and plot definition.</p>
    <p>
      <tt>
        <b>rec</b>
      </tt> is a typed list with type <tt>
        <b>"SPLOT"</b>
      </tt>. Each
    of its <tt>
        <b>2:$</b>
      </tt> fields contains a graphic instruction definition
    and its parameters. <tt>
        <b>rec(i)(1)</b>
      </tt> gives the fields names of the
    <tt>
        <b>i</b>
      </tt> th graphic instruction</p>
    <p>
      <tt>
        <b>txt=string(rec)</b>
      </tt> generates the Scilab instructions which
    reproduce the plot. To make the necessary functions known, load the
    <tt>
        <b>loadplots</b>
      </tt> function first. This can be done with the
    instruction</p>
    <pre>loadplots;</pre>
    <p>
      <b>Warning</b>: The <tt>
        <b>loadplots</b>
      </tt> function is currently
      available with the graphic files saved under the old graphic mode.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

set old_style on // switch to old graphic mode
driver('Rec');xbasc();plot2d([0 1.5 4]) //make a plot
xsave(TMPDIR+'/foo.scg') //save it in a binary file

rec=loadplots(TMPDIR+'/foo.scg'); //get the associated data structure
//here rec($) is the data structure associated with the plot2d instruction
rec($).x //the x vector
rec($).y //the y vector

string(rec) //the scilab instructions producing the same plot

mputl(string(rec),TMPDIR+'/foo.sce') //creates a script file
xbasc();exec(TMPDIR+'/foo.sce',-1) //execute it to re-create the plot

xbasc();
set old_style off  // switch nack to new graphic mode
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="xsave.htm">
        <tt>
          <b>xsave</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="xload.htm">
        <tt>
          <b>xload</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
